<%@page contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true" pageEncoding="UTF-8" %>
<html>
<head>
    <%@include file="/WEB-INF/include/include.jsp" %>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body" pad15>
                    <form class="layui-form layui-form-pane" action="${pageContext.request.contextPath}/system/user/update" method="post">
                        <input type="hidden" name="id" value="${model.id}">
                        <div class="layui-tab">
                            <%--<ul class="layui-tab-title">
                                <li><a href="${pageContext.request.contextPath}/system/user/list">用户列表</a></li>
                                <li class="layui-this">用户编辑</li>
                            </ul>--%>
                            <h3 class="page-header">用户编辑</h3>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label"><font color="red">账号</font></label>
                                            <div class="layui-input-block">
                                                <input type="text" name="username" value="${model.username}" readonly="readonly" lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label"><font color="red">姓名</font></label>
                                            <div class="layui-input-block">
                                                <input type="text" name="name" value="${model.name}" lay-verify="required" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label"><font color="red">部门</font></label>
                                            <div class="layui-input-block">
                                                <select name="deptId" lay-verify="required">
                                                    <option value=""></option>
                                                    <c:forEach var="dept" items="${deptList}">
                                                        <option value="${dept.id}" <c:if test="${model.deptId == dept.id}">selected="selected"</c:if>>${dept.name}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">职务</label>
                                            <div class="layui-input-block">
                                                <select name="dutyId">
                                                    <option value="0"></option>
                                                    <c:forEach var="duty" items="${dutyList}">
                                                        <option value="${duty.id}" <c:if test="${model.dutyId == duty.id}">selected="selected"</c:if>>${duty.name}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">出生日期</label>
                                            <div class="layui-input-block">
                                                <input type="text" id="birthday" name="birthday" lay-verify="date" value="<fmt:formatDate value="${model.birthday}" pattern="yyyy-MM-dd"/>" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">工号</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="card" value="${model.card}" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">手机号</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="phone" lay-verify="phone" value="${model.phone}" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">邮箱</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="email" value="${model.email}" lay-verify="email" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">地址</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="address" value="${model.address}" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">是否启用</label>
                                            <div class="layui-input-block">
                                                <input type="radio" name="isEnable" value="1" title="是" <c:if test="${model.isEnable == true}">checked="checked"</c:if>>
                                                <input type="radio" name="isEnable" value="0" title="否" <c:if test="${model.isEnable == false}">checked="checked"</c:if>>
                                            </div>
                                        </div>
                                        <div class="layui-col-md6">
                                            <label class="layui-form-label">性别</label>
                                            <div class="layui-input-block">
                                                <input type="radio" name="gender" value="M" title="男" <c:if test="${model.gender == 'M'}">checked="checked"</c:if>>
                                                <input type="radio" name="gender" value="F" title="女" <c:if test="${model.gender == 'F'}">checked="checked"</c:if>>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="padding-left: 10px;">
                            <div class="layui-input-block">
                                <shiro:hasPermission name="user:edit">
                                    <button class="layui-btn layui-btn-normal" lay-submit >提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </shiro:hasPermission>
                                <a href="javascript:history.back();" class="layui-btn layui-btn-primary">返回</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        laydate.render({
            elem: '#birthday'
        });
    });
</script>
</body>
</html>